<%= render(:partial => 'pageoptions') %>

<div class="sectionwrap">
    <%= render(:partial => 'story/title') %>
    
    <% for word in @words %>
        <div class="studypagination">
            <% if @word_pages.length > 1 then  %>
                <% if @story then %>
                        <%= if !@word_pages.current.first? then link_to "&lt; Prev", :page=> @word_pages.current.previous, :params => {:story_id => @story.id} else "&lt; Prev" end %> 
                        <%= if !@word_pages.current.last? then link_to "Next &gt;", :page=> @word_pages.current.next, :params => {:story_id => @story.id} unless @word_pages.current.last? else "Next &gt;" end %>
                <% else %>
                        <%= if !@word_pages.current.first? then link_to "&lt; Prev", :page=> @word_pages.current.previous else "&lt; Prev" end %> 
                        <%= if !@word_pages.current.last? then link_to "Next &gt;", :page=> @word_pages.current.next else "Next &gt;" end %>
                <% end %>
            <% end %>
        </div>
        <div id="onewordwrap">
            <span class="oneword"><%= word.word.chomp %></span>
            <p>
            <% if @story then %>
                    <%= link_to "edit", {# link_to options
                                    :controller => 'word',
                                    :action => 'edit_word',
                                    :story_id => @story.id,
                                    :id => word.id},
                                    {:class => "optionlink"
                                    } %>
                    <%= " | " %>
            <% end %> 
            <%= link_to "exclude word", {# link_to options
                                    :controller => 'dud',
                                    :action => 'exclude_word',
                                    :word => h(word.word)},
                                    {:class => "optionlink"
                                    }  %> 
            </p>
        </div>
        
    <% end %>
</div>